VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



VB.NET CODE -->Read & write a Single Line in a File (Simple Code)If you searching a Easy way of Wri

by Santhosh Kumar (1 Submission)
Category: Files/File Controls/Input/Output
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 2nd June 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

VB.NET CODE -->Read & write a Single Line in a File (Simple Code)If you searching a Easy way of Writing/Reading a File.Your Search ends here!!!

API Declarations


Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0


Rate VB.NET CODE -->Read & write a Single Line in a File (Simple Code)If you searching a Easy way of Wri



        fso.CreateTextFile("test1.txt")           ' Create a file.
        f = fso.GetFile("C:\test1.txt")
        ts = f.OpenAsTextStream(ForWriting, TristateUseDefault)
        ts.Write("Hello World")
        ts.Close()
        ts = f.OpenAsTextStream(ForReading, TristateUseDefault)
        s = ts.ReadLine()
        ts.Close()
        MsgBox(s)


Download this snippet    Add to My Saved Code

VB.NET CODE -->Read & write a Single Line in a File (Simple Code)If you searching a Easy way of Wri Comments

No comments have been posted about VB.NET CODE -->Read & write a Single Line in a File (Simple Code)If you searching a Easy way of Wri. Why not be the first to post a comment about VB.NET CODE -->Read & write a Single Line in a File (Simple Code)If you searching a Easy way of Wri.

Post your comment

Subject:
Message:
0/1000 characters